<template>
    <div class="reaTimeContainer">
        <div class="reaTimeTitle">
            <span class="name">{{ id }}:</span>
            <span class="data" v-text="realTimeData"></span>
            <span class="SI" v-text="chartData.axisName.yName"></span>
        </div>
        <div class="realChart">
            <small-chart
                :id="id"
                :axisData="chartData.axisData"
                :axisName="chartData.axisName"
                :title="chartData.title"
                :y-min-and-y-max="chartData.yMinAndyMax"
            ></small-chart>
        </div>
    </div>
</template>
<script>
import smallChart from '@/components/smallChart';

export default {
    name: 'realTimeData',
    data() {
        return {};
    },
    components: {
        smallChart
    },
    props: {
        id: { type: String, require: true },
        chartData: { type: Object, require: true }
    },
    computed: {
        realTimeData: function () {
            return this.chartData.axisData.yData[this.chartData.axisData.yData.length - 1];
        }
    }
};
</script>
<style lang="less" scoped>
.reaTimeContainer {
    width: 100%;
    height: 100%;

    .reaTimeTitle {
        width: 100%;
        padding: 10px;

        .name {
            font-size: 18px;
            font-weight: 700;
        }

        .data {
            padding: 0 10px 0 10px;
            font-size: 18px;
            color: orange;
        }

        .SI {
            font-size: 16px;
            font-weight: 600;
        }
    }

    .realChart {
        width: 100%;
        height: 100%;
    }
}
</style>
